/**
 * zoneland.net Inc.
 * Copyright (c) 2002-2013 All Rights Reserved.
 */
package net.zoneland.knowledge.enums;

import java.util.Optional;
import java.util.UUID;
import java.util.stream.Stream;

/**
 * 数据字典分类定义.
 * @author Pbody
 * @date 22:04 2020/3/15
 **/
public enum DictParentEnum {
    /**
     * 开场语配置.
     */
    TALK_OPENING_WORDS("opening_words", "开场语配置"),
    /**
     *离场语配置.
     */
    TALK_LEAVE_WORDS("leave_words", "离场语配置"),
    /**
     *表情问答配置.
     */
    EMOJI_TALK("emoji", "表情问答配置"),
    /**
     *热点问题默认列表.
     */
    HOT_QUESTIONS("hot_questions", "热点问题默认列表"),
    /**
     *搜索排行默认列表.
     */
    SEARCH_QUESTIONS("search_questions", "搜索排行默认列表"),
    /**
     *问答失败的友好提示模板.
     */
    TALK_ANSWER_DEFAULT("talk_default", "问答失败的友好提示模板"),
    /**
     *问答禁用词.
     */
    STOP_TERM("stop_term", "问答禁用词"),
    /**
     *搜索固定关键字.
     */
    SEARCH_FIX_KEYWORD("searchFixKeyword", "搜索固定关键字"),
    /**
     *搜索引导特殊页面的关键字.
     */
    SEARCH_NAVIGATE_PAGE_KEYWORD("searchNavigatePageKeyword", "搜索引导特殊页面的关键字"),
    /**
     *智办部门管理员.
     */
    WISDOM_DEPT_ADMIN("wisdomDeptAdmin", "智办部门管理员"),

    /**
     *状态.
     */
    STATUS("status", "状态"),

    /**
     * R慧办-热门业务
     */
    RHB_HOT_BUSINESS("rhbHotBusiness", "R慧办-热门业务"),

    NO_ANSWER_REPLY("noAnswerReply", "没有答案回复");

    private String value;
    private String name;

    DictParentEnum(String value, String name) {
        this.name = name;
        this.value = value;
    }

    /**
     * Gets the value of value.
     *
     * @return the value of value
     */
    public String getValue() {
        return value;
    }

    /**
     * Gets the value of name.
     *
     * @return the value of name
     */
    public String getName() {
        return name;
    }

    public static String getNameByValue(String value) {
        return Optional.ofNullable(
                Stream.of(DictParentEnum.values())
                        .filter(x -> x.getValue().equalsIgnoreCase(value))
                        .findFirst().orElse(null)
        ).map(DictParentEnum::getName).orElse(null);
    }

    public static void main(String[] args) {
        for (int i = 0; i < 395; i++) {
            System.out.println(UUID.randomUUID().toString());
        }

    }
}
